package com.yubest.demo;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Author hweiyu
 * @Description
 * @Date 2021/2/25 16:02
 */
@Data
@Accessors(chain = true)
public class MusicAnalysis {

    private Command command;

    private Context context;

    public void analysis() {
        getCommand().execute(getContext());
    }

    public static void main(String[] args) {

        //方式一
        new MusicAnalysis()
                .setCommand(new PcCommand())
                .setContext(new Context()
                        .setInPath("D:\\workspace\\others\\cloud-music-crack\\src\\main\\resources\\demo.uc")
                        .setOutPath("D:\\CloudMusic\\Cache\\Cache\\1.mp3"))
                .analysis();

        //方式二
        new MusicAnalysis()
                .setCommand(new WebCommand())
                .setContext(new Context()
                        .setInPath("https://m10.music.126.net/20210225175901/23eb259471de64984959621013e83c73/yyaac/obj/wonDkMOGw6XDiTHCmMOi/3045518290/facd/47c1/b454/5dcc1fbeb692dff81483114aabfbe70d.m4a")
                        .setOutPath("D:\\CloudMusic\\Cache\\Cache\\2.m4a"))
                .analysis();

    }
}
